json.result   true
json.message  "获取分类成功"
json.data @shop_categories do |shop_category|
  json.id           shop_category.id
  json.name         shop_category.name
  json.avatar       shop_category.avatar.url
  json.parent_id    shop_category.parent_id
  json.level        shop_category.level
  json.children     shop_category.children.where(published: true) do |child|
    json.id           child.id
    json.name         child.name
    json.avatar       child.avatar.url
    json.parent_id    child.parent_id
    json.level        child.level
  end
end